    <style>
	.admin_window { background-color:#F0F0F0;clear:both;line-height:24px;margin:0;padding:0 5px; font-size:12px; }
    </style>
	<body>
    <div id="container">
   		<div class="admin_window">{:L(addCategory_0001)}</div>
        <div style="width:90%">
        	<dl class="mt10 cont_C">
            	<dt>{:L(addCategory_0009)}</dt>
                <dd> <select id="category" name="category" style="width:100px;" class="mt10">
                <volist name="category" id="vo">
                		<option value="{$vo.id}">{$vo.name}</option>
                </volist>
                </select></dd>
            </dl>
            <dl class="mt10 cont_C">
            	<dt>{:L(addCategory_0006)}</dt>
                <dd><input id="newCategory" name="newCategory"  class="mt10" style="width:100%; height:20px;"/></dd>
            </dl>
        </div>
			</div>
   <script>
		 $( document ).ready( function(){
							$('#cate_yes').click(function(){
															category = $( '#newCategory' ).val();
															category = $.trim(category);
														 var 	pid      = $('#category').val();
																if( category != "" ){
																		$.post( URL+"&act=doAddCategory",{pid:pid,name:category},function( txt ){
																				if( -1 == txt ){
																						$.tbox.no( '{:L(addCategory_0008)}','{:L(addCategory_0010)}' );
																				}else if(  -2  == txt){
																						$.tbox.yes( '{:L(addCategory_0007)}' );
																				}else if( -3 == txt  ){
																								$.tbox.no( '{:L(addCategory_0003)}' );
																				}else{
																						select = $( '#group' );
																						select.before( select.children(':first').clone().val(txt).html(category));
																				$("#select option[value='"+txt+"']").attr( 'selected',true );
																						$.tbox.close();
																						return;
																				}
																				setTimeout('$.tbox.close()',3000);
																		})
																
																}else{
																	alert( '{:L(addCategory_0005)}' );
														}
              select = $( '#select' );
              select.children( ':first' ).attr( 'selected',true );
														$.tbox.close();
							});
							
							$('#cate_no').click(function(){
																																					var title = $('#newCategory').val();
																																				title = $.trim(title);
																																				if(title != ''){
																																						if ( false == window.confirm('{:L(addCategory_0000)}'))	{
																																								return ;
																																						}else{
																																										$.tbox.close();
																																						}
																																				}else{
																																						$.tbox.close();
																																				}
																																				});
    });	
			</script>